using Mvc.Mailer;
using OurWedding1.Models;
using System.Collections.Generic;
using System;

namespace OurWedding1.Mailers
{ 
    public class UserMailer : MailerBase, IUserMailer 	
	{
		public UserMailer()
		{
			MasterName="_Layout";
		}

        public virtual MvcMailMessage Confirmed(GuestGroup GuestGroup, IEnumerable<UserProfile> Users)
        {
            //ViewBag.Data = someObject;
            return Populate(x =>
            {
                x.Subject = String.Format("{0} : {1}", @Resources.Confirm_MailerConfirmedSubject, GuestGroup.Name);
                x.ViewName = "Confirmed";
                foreach (var item in Users)
                {
                    if (item.Email != "") //TODO:Check if the email is valid
                    {
                        x.To.Add(item.Email);
                    }
                }

                //x.To.Add("anna.malinowska@gmail.com");
            });
        }

       
 	}
}